# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-publicsuffix2
_pkgname=python-publicsuffix2
_pkgver=2.2019-12-21
pkgver=${_pkgver//-}
pkgrel=4
pkgdesc="Python library to deal with publicsuffix data"
url="https://github.com/nexB/python-publicsuffix2"
license="MIT AND MPL-2.0"
arch="noarch"
depends="python3 py3-requests"
makedepends="py3-setuptools"
checkdepends="py3-pytest"
subpackages="$pkgname-pyc"
source="$_pkgname-release-$_pkgver.tar.gz::https://github.com/nexB/python-publicsuffix2/archive/release-$_pkgver.tar.gz"
builddir="$srcdir/$_pkgname-release-$_pkgver"

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH="$PWD"/build/lib pytest
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"

	# remove stray license file; SPDX identifier is sufficient in Alpine
	rm "$pkgdir"/usr/lib/python3.*/site-packages/publicsuffix2/mpl-2.0.LICENSE
}

sha512sums="983bdb17b76d10eb73cf69f0ba7590806bf6786ae0c30526593ce1ab97f3b22c967f9acae83b880dd56be41a29eae9cca5726926667eb74013d0d1078433bf05  python-publicsuffix2-release-2.2019-12-21.tar.gz"
